Recently, in rereading data in a storage area such as a sector in a hard disk drive (HDD), averaging retry has sometimes been performed. The averaging retry performs reading of sample values from a sector a plurality of times, calculates respective average values of the sample values obtained by reading the plurality of times, and obtains the calculated average values as data read from the sector. This allows for an attempt to demodulate data with reduced randomly-occurring noise in rereading the data from a sector.
When data written in a sector is damaged, or when a path of a head when data is written to a sector is different from a path of the head when the data is read from the sector, or when sampling of a read signal is failed, for example, quality of sample values read from the sector may be bad. Therefore, it has been required to optimize sample values used for acquiring data in the averaging retry.